<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"  pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="spring" uri="/WEB-INF/lib/spring.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib prefix="z" uri="/WEB-INF/lib/zerdoor.tld"%>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><spring:message code='race_info.title.msg1' /></title>
<link href="${path}/style/acg/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" media="screen" href="${path}/plugins/validate/validate.css">
<script src="${path}/js/jquery.min.js" type="text/javascript"></script>
<script src="${path}/plugins/validate/jquery.validate.min.js" type="text/javascript"></script>
<c:if test="${ sessionScope.language == '' || sessionScope.language == 'zh_cn'}">
    <script src="${path}/plugins/validate/messages_cn.js" type="text/javascript"></script>
</c:if>
<%--<script type="text/javascript" src="${path}/js/jquery-2.1.1.js"></script>--%>
<%--<script type="text/javascript" src="${path}/style/acg/js/common.js"></script>--%>

<!-- 文件上传JS -->
<script type="text/javascript" src="${path}/js/ajaxfileupload.js"></script>

<style type="text/css">
    .validateMoney{
        color: red;
        font-weight: bold;
    }
</style>

<script type="text/javascript">

$(function(){

    if("${curUser.userId}" == "" ){

        alert("<spring:message code='race_info.alert.tipLogin' />");
        window.location.href = "${path}/login/index.html"

        return;
    }

    f_init();

    //处理从下一页返回回来
    f_backPage();

});
var validate = null;
//初始化函数
function f_init(){
    //初始化一级分类

    f_findPajectType(1,"first_class");

    $("#first_class").change(function(){
        f_findPajectType($(this).val(),"second_class");
    });



    //绑定选择框事件
    $(".zsys input[type='checkbox']").click(function(){


        if(!$(this).attr("checked")){
            $(this).attr("checked","checked");
        }else{
            $(this).removeAttr("checked");
        }

    });

    //加入验证
    //f_saveItem();


    validate = $("#taskForm").validate({
        rules : {
            title:{
                required: true
            },
            description:{
                required: true
            },
            skill:{
                required: true
            }


        },
        messages : {

        },
        success: function(label) {//验证成功添加样式
            label.html("&nbsp;").removeClass("checked").addClass("checked");
        }

    });
}

/**级联查询分类*/
function f_findPajectType(parent,selID){

    $.post("${path}/taskList/findTaskTypeByParent.html", { parent: parent},
            function(data, textStatus){

                var tempArr = new Array();
                var html = "";
                for (i in data) {

                    var type = data[i];
                    html += "<option value='" + type.id + "' skill='"+type.skill+"'>" + type.name + "</option>";

                    tempArr.push(type.id);
                }

                $("#"+selID).html(html);

                //如果为一级分类，则默认初始化二级分类
                if("first_class" == selID){

                    //返回处理
                    if($("#first_class_type").val() != "" && $("#first_class_type").val() != null){
                        $("#"+selID).val($("#first_class_type").val());
                    }

                    f_findPajectType($("#"+selID).val(),"second_class");
                }else{

                    //返回处理
                    if($("#second_class_type").val() != "" && $("#second_class_type").val() != null){

                        var second_class_type = parseInt($("#second_class_type").val());
                        var boo = false;
                        for(var item in tempArr){

                            if(second_class_type == tempArr[item]){
                                boo = true;
                            }
                        }
                        if(!boo){
                            $("#"+selID).val();
                        }


                    }

                    f_findSkill();
                }

            });
}

/**级联查询需求技能*/
function f_findSkill(){

    var skill = $("#second_class").find("option:selected").attr("skill");

    if(skill == ""){
        $(".skill_list").html("");
        return;
    }

    $.post("${path}/raceInfo/findSkillBySkillIds.html", { skillIds: skill},
            function(data, textStatus){

                var html = "";
                for (i in data) {

                    var type = data[i];
                    html += "<a href=\"javascript:;\" class=\"skill_li\" value=\""+type.id+"\">"+type.name+"</a>";
                }

                $(".skill_list").html(html);


                f_aClick(".skill_list a","#skill");


                //处理返回
                var skill = $("#skill").val();
                var skill_arr = skill.split(",");
                for(var i in skill_arr){

                    if(skill_arr[i] != ""){
                        $(".skill_list a").each(function(){

                            if($(this).attr("value") == skill_arr[i]){
                                $(this).addClass("selected");

                            }
                        });

                    }

                }

            });
}

//Ajax文件上传
function f_file_upload(fileInputId){

    //var result =/\.[^\.]+/.exec($("#fulAchievements").val());

    var path = $("#"+fileInputId).val();

    var pos1 = path.lastIndexOf("\\");
    var pos2 = path.lastIndexOf(".");
    var pos = path.substring(pos1 + 1, pos2);

    var fileName = path.substring(pos1+1,pos2);

    var str = $("#"+fileInputId).val().split(".");
    var result = path.substring(pos2 + 1,path.length );

    var rars = ".rar.zip.7z.cab.RAR.ZIP.7Z.CAB";

    var imgs = ".bmp.jpg.dib.jpeg.png.jfif.jpe.tif.tiff.gif.BMP.JPG.DIB.JPEG.PNG.JFIF.JPE.TIF.TIFF.GIF";

    //文件类型 false为压缩包
    var boo = false;

    //判断上传的是项目图片还是项目附件
    if("fulAchievements1" == fileInputId){
        if(imgs.indexOf(result) > -1){
            boo = true;
        }else{

            alert(" <spring:message code='race_info.alert.upload' arguments='.bmp.jpg.dib.jpeg.png.jfif.jpe.tif.tiff.gif' argumentSeparator=','/>");
            $("#"+fileInputId).val("");
            return;
        }
    }else{

        if(rars.indexOf(result) > -1){
//            console.log("压缩包");
        }else if(imgs.indexOf(result) > -1){
            boo = true;
//            console.log("图片");
        }else{

            alert("<spring:message code='race_info.alert.upload2' arguments='.rar.zip.7z.cab,.bmp.jpg.dib.jpeg.png.jfif.jpe.tif.tiff.gif' argumentSeparator=','/>")
            $("#"+fileInputId).val("");
            return;
        }
    }

    $.ajaxFileUpload({
        url: '${path}/fileUpload/upload_resource_file.html',
        secureuri: false,
        fileElementId: fileInputId,
        //dataType: 'json',
        success: function (data) {
            //data = $.parseJSON(data);

            var data2 = data.split(",");

            var url = data2[0].replace(" ","");
            fileName = data2[1].replace(" ","");

            var src = "${path}/style/common/images/yasuobao.png";
            if(boo){
                src = "${path}/"+url;
            }

            if("fulAchievements1" == fileInputId){
                f_item_pic(src,url,fileName);
            }else{
                f_attachment(src,url,fileName);
            }



        },
        error:function(data){

            console.log("error");
            console.log(data);
        }
    });
}

//项目图片
function f_item_pic(src,url,fileName){

    var html = "";

    html += "<li>";
    html += "<em class='ico_del' onclick=\"f_removeAttchment('"+url+"',this,'item_pic',true)\" >×</em>";
    html += "<img src='"+src+"' width='56' height='70' />";
    html += "        <p>"+fileName+"</p>";

    if($("#item_pic").val() == "" && $("#item_front_cover").val() == ""){
        html += "<a onclick=\"f_setCover('"+url+"',this)\"   ><spring:message code='race_info.msg.coverContest' /></a>";

        $("#item_front_cover").val(url);



    }else if( $("#item_front_cover").val() != "" && url == $("#item_front_cover").val()) {

        html += "<a onclick=\"f_setCover('"+url+"',this)\"   ><spring:message code='race_info.msg.coverContest' /></a>";

    }else{

        html += "<a onclick=\"f_setCover('"+url+"',this)\"   ><spring:message code='race_info.msg.makeCover' /></a>";
    }

    html += "</li>";

    //设置值
    $("#item_pic").val($("#item_pic").val()+ url + "," );
    //显示
    $("#item_pic_ul").html($("#item_pic_ul").html() + html);

    f_validateText("item_pic","item_pic_msg");

}
//项目附件
function f_attachment(src,url,fileName){
    var html = "";

    html += "<li>";
    html += "<em class='ico_del' onclick=\"f_removeAttchment('"+url+"',this,'attachment',false)\" >×</em>";
    html += "<img src='"+src+"' width='56' height='70' />";
    html += "        <p>"+fileName+"</p>";


    html += "</li>";

    //设置值
    $("#attachment").val($("#attachment").val()+ url + "," );
    //显示
    $("#attachment_ul").html($("#attachment_ul").html() + html);
}

//根据附件数组下标删除元素
function f_removeAttchment(url,obj,inputId,flag){


    if(flag){

        if($("#item_front_cover").val() == url){

            alert("<spring:message code='race_info.alert.projectCover' />")
            return;
        }

    }

    //把数组元素赋空值
    $("#" + inputId).val($("#" + inputId).val().replace(url + ",",""));

    //删除元素
    $(obj).parent().remove();

}

//设置为封面
function f_setCover(url,obj){


    $("#item_pic_ul").find("a").each(function(){

        $(this).html("<spring:message code='race_info.msg.makeCover' />")
    });

    $("#item_front_cover").val(url);

    $(obj).html("<spring:message code='race_info.msg.coverContest' />");

}

/**a点击事件 传入选择器*/
function f_aClick(selID,inputID){

    $(selID).click(function() {


        if($(this).attr("class").indexOf("selected") > -1){
            $(this).removeClass("selected");

            //$(inputID).val($(inputID).val().replace($(this).attr("value")+",",""));
            var tempArr = $(inputID).val().split(",");

            for(var i in tempArr){

                if(tempArr[i] == $(this).attr("value")){

                    tempArr.splice(i,1);

                }
            }

            $(inputID).val(tempArr.join(","));
        }else{
            $(this).addClass("selected");

            if(inputID != null && inputID != undefined){

                var sp = "";

                if($(inputID).val()!=null && $(inputID).val() != ""){
                    var str = $(inputID).val().substring($(inputID).val().length - 1 ,$(inputID).val().length);

                    if(str != ","){
                        sp = ",";
                    }
                }


                $(inputID).val( $(inputID).val()+ sp + $(this).attr("value") + ",");
            }
        }



    });

}

//按钮加一事件
function f_buttonAdd(inputId,radioId){

    //如果为空 那么久赋值为1，否者取出原来的值进行加一
    if($("#"+inputId).val() == ""){


        $("#"+inputId).val("1")
    }else{


        $("#"+inputId).val(parseInt($("#"+inputId).val()) + 1 );
    }

    //如果radioID有值，那么就赋值
    if(radioId != undefined){
        $("#"+radioId).val($("#"+inputId).val());
    }

}

//按钮减一事件
function f_buttonMinus(inputId,radioId){

    //如果为空 那么久赋值为1，否者取出原来的值进行减一
    if($("#"+inputId).val() == "" || $("#"+inputId).val() == "1"){

        $("#"+inputId).val("1");
    }else{

        $("#"+inputId).val(parseInt($("#"+inputId).val()) - 1 );
    }

    //如果radioID有值，那么就赋值
    if(radioId != undefined){
        $("#"+radioId).val($("#"+inputId).val());
    }
}

//设置radio值
function f_setRadio(radioId,obj){

    $("#"+radioId).val($(obj).val());

}

//保存项目信息
function f_saveItem(){


    var boo = f_validates();

    if(!boo ){
        return;

    }
    var boo2 = validate.form();
    if( !boo2){
        return;

    }



    <%--,--%>
    <%--submitHandler : function(){--%>


    $("#addvalue_ids").val("");
    $("#addValueDD input[type='checkbox']").each(function(i){


        if($(this).attr("checked")){
            $("#addvalue_ids").val( $(this).val() + "," + $("#addvalue_ids").val() );
        }

    });
    var ids = $("#addvalue_ids").val();
    if( ids != ""){

        $("#addvalue_ids").val(ids.substring(0,ids.length - 1));
    }

    var skill =$("#skill").val();
    if( skill != ""){

        $("#skill").val(skill.substring(0,skill.length - 1));
    }

    var racePrizes = "";

    $("#prizeTable tbody").find("tr").each(function(i){


        racePrizes += "name=" + $(this).find("input").val() + ",";
        racePrizes += "num=" + $(this).find(".reward_number input").val() + ",";
        racePrizes += "money=" + $(this).find(".reward_moeny input").val();

        racePrizes += "&";
    });

    if( racePrizes != ""){

        racePrizes = racePrizes.substring(0,racePrizes.length - 1);
    }
    $("#racePrizes").val(racePrizes);


    $.post("${path}/raceInfo/insertTaskInfo.html",
            $("#taskForm").serialize()
            ,function(data){
                if(data != "error" && data != "debug"){
                    //alert("<spring:message code="bid.result_success"/>");
                    $("#race_id").val(data);



                    //赋值给临时表单
                    $("#first_class_type").val($("#first_class").val());
                    $("#second_class_type").val($("#second_class").val());

                    window.location = "${path}/raceInfo/confirmRaceInfo.html?raceId="+data;
                }else if(data == "debug"){

                    alert("<spring:message code='race_info.alert.paid' />");

                }else{
                    // alert("<spring:message code="bid.result_fail"/>");
                }
            });
    <%--}--%>

}

function f_validates(){

    //验证只能是数字
    var boo4 = f_validateNumber("i_race_time","race_time_msg");
    var boo7 = f_validateText("item_pic","item_pic_msg");

    if( boo4  && boo7){

        return true;
    }

    return false;

}
//验证表单是否为空，传入输入框ID和提示标签ID
function f_validateText(inputId,msgId){

    if($("#" + inputId).val().replace(/\s+/,'') != ''){
        $("#"+msgId).html("<label id='title-error' class='error checked' for='"+inputId+"'>&nbsp;</label>");
        return true;
    }

    $("#"+msgId).html("<label id='title-error' class='error'  for='"+inputId+"'><spring:message code='race_info.label.requiredFields' /></label>");

    return false;

}

//验证是否是数字，传入输入框ID和提示标签ID
function f_validateNumber(inputId,msgId){


    //定义正则表达式部分
    //var reg = /^\d+$/;
    var reg = /^[0-9]+$/;
    if( $("#"+inputId).val().constructor === String ){
        var re = $("#"+inputId).val().match( reg );
        if(re != null){
            $("#"+msgId).html("<label id='title-error' class='error checked' for='"+inputId+"'>&nbsp;</label>");
            return true;
        }

    }
    $("#"+msgId).html("<label id='title-error' class='error'  for='"+inputId+"'><spring:message code='race_info.label.legalDigital' /></label>");
    $("#"+inputId).blur(function(e){
        f_validateNumber(inputId,msgId);
    });
    return false;
}

//删除该奖项
function f_delPrize(obj){

    if($("#prizeTable tbody").find("tr").length == 1){
        alert("<spring:message code='race_info.alert.retainA' />");
        return;
    }

    //删除元素
    $(obj).parent().parent().parent().remove();
}

//增加奖项
function f_addPrize(){

    var html = "";

    html += "<tr>";
    html += "<td><input type=\"text\" name=\"\" class=\"input_name\" value=\"<spring:message code='race_info.msg.awardWinning' />\" /></td>";
    html += "<td>";
    html += "<div class=\"reward_number clearfix\">";
    html += "        <input type=\"text\" onblur=\"f_numValidate(this,'moneyMsg')\" name=\"\" value=\"1\" /><label><spring:message code='race_info.msg.name' /></label>";
    html += "</div>";
    html += "</td>";
    html += "<td>";
    html += "<div class=\"reward_moeny clearfix\">";
    html += "        <input type=\"text\" onblur=\"f_moneyValidate(this,'moneyMsg')\"  name=\"\" value=\"5000\" /><label><spring:message code='race_info.msg.yuan' /></label>";
    html += "</div>";
    html += "</td>";
    html += "<td>";
    html += "<div class=\"delitem\"><a onclick=\"f_delPrize(this)\"><em>-</em><spring:message code='race_info.msg.deleteThis' /></a></div>";
    html += "</td>";
    html += "</tr>";

    $("#prizeTable tbody").append( html);
}

//金额验证
function f_moneyValidate(obj,span){

    var data = "";

    var re = /^\d+(?=\.{0,1}\d+$|$)/;
    if (obj.value != "") {
        if (!re.test(obj.value)) {

            data = "<spring:message code='race_info.msg.correctAmount' />";
            $("#" + span).addClass("validateMoney");
            obj.focus();
        }else{
            data = "";

            $("#" + span).removeClass("validateMoney");
        }
    }else{


        obj.value = 0;
        data = "";
    }



    $("#" + span).html(data);

}

//人数验证
function f_numValidate(obj,span){

    var data = "";

    var re = /^\d+(?=\{0,1}\d+$|$)/;
    if (obj.value != "") {
        if (!re.test(obj.value)) {

            data = "<spring:message code='race_info.msg.correctInteger' />";
            $("#" + span).addClass("validateMoney");
            obj.focus();
        }else{
            data = "";

            $("#" + span).removeClass("validateMoney");
        }
    }else{


        obj.value = 0;
        data = "";
    }



    $("#" + span).html(data);

}

//处理从上一页返回回来的操作
function f_backPage(){

    //如何race_id为空，那么就默认不处理
    if($("#race_id").val() == ""){
        return;
    }

    //取出隐藏表单中的值
    var item_pic = $("#item_pic").val();
    var item_front_cover = $("#item_front_cover").val();
    var attachment = $("#attachment").val();

    //赋空值
    $("#item_pic").val("");
    $("#item_front_cover").val("");
    $("#attachment").val("");

    //处理项目图片
    var item_pic_arr = item_pic.split(",");
    for(var i in item_pic_arr){

        if(item_pic_arr[i] != ""){

            var src = "${path}/" + item_pic_arr[i];
            var url = item_pic_arr[i];
            var fileName = item_pic_arr[i].replace(/^.*[\\\/]/, '');

            f_item_pic(src,url,fileName);
        }

    }

    //处理附件
    var attachment_arr = attachment.split(",");
    for(var i in attachment_arr){

        if(attachment_arr[i] != ""){

            var src = "${path}/" + attachment_arr[i];
            var url = attachment_arr[i];
            var fileName = attachment_arr[i].replace(/^.*[\\\/]/, '');

            var path = url;
            var pos1 = path.lastIndexOf("\\");
            var pos2 = path.lastIndexOf(".");
            var pos = path.substring(pos1 + 1, pos2);
            //var fileName = path.substring(pos1+1,pos2);
            var str = url.split(".");
            var result = path.substring(pos2 + 1,path.length );
            var rars = ".rar.zip.7z.cab.RAR.ZIP.7Z.CAB";


            if(rars.indexOf(result) > -1) {
                //console.log("压缩包");

                src = "${path}/style/common/images/yasuobao.png";
            }
            f_attachment(src,url,fileName);
        }

    }




    //处理增值服务
    var addvalue_ids = $("#addvalue_ids").val().split(",");


    for(var i in addvalue_ids){

        if(addvalue_ids[i] != ""){

            $(".zsys input[type='checkbox']").each(function(){

                if($(this).val() == addvalue_ids[i]){

                    $(this).attr("checked","checked");
                }

            });


        }


    }

    //处理奖项
    f_showRacePrizes();


}

//获得奖项HTML
function f_showRacePrizes(){
    var racePrizesStr = $("#racePrizes").val();

    var racePrizes = racePrizesStr.split("&");

    var html = "";

    for(var i = 0; i < racePrizes.length; i++){

        var temPracePrize = {name:"",num:"",money:""};

        var tempStr = racePrizes[i].split(",");

        for(var j = 0; j < tempStr.length; j++){

            var str = tempStr[j].split("=");

            if("name" == str[0]){

                if(str.length == 2){

                    temPracePrize.name = str[1];
                }
            }
            if("num" == str[0]){

                if(str.length == 2){

                    temPracePrize.num = str[1];
                }
            }
            if("money" == str[0]){

                if(str.length == 2){

                    temPracePrize.money = str[1];
                }
            }
        }
        html += f_raceHtml(temPracePrize)
    }
    $("#prizeTable tbody").html( html);

}

function f_raceHtml(pracePrize){

    var html = "";

    html += "<tr>";
    html += "<td><input type=\"text\" name=\"\" class=\"input_name\" value=\""+pracePrize.name+"\" /></td>";
    html += "<td>";
    html += "<div class=\"reward_number clearfix\">";
    html += "        <input type=\"text\" onblur=\"f_numValidate(this,'moneyMsg')\" name=\"\" value=\""+pracePrize.num+"\" /><label><spring:message code='race_info.msg.name' /></label>";
    html += "</div>";
    html += "</td>";
    html += "<td>";
    html += "<div class=\"reward_moeny clearfix\">";
    html += "        <input type=\"text\" onblur=\"f_moneyValidate(this,'moneyMsg')\"  name=\"\" value=\""+pracePrize.money+"\" /><label><spring:message code='race_info.msg.yuan' /></label>";
    html += "</div>";
    html += "</td>";
    html += "<td>";
    html += "<div class=\"delitem\"><a onclick=\"f_delPrize(this)\"><em>-</em><spring:message code='race_info.msg.deleteThis' /></a></div>";
    html += "</td>";
    html += "</tr>";

    return html;
}


</script>
</head>

<body>
<div class="header">
    <jsp:include page="../public/header.jsp">
        <jsp:param    name="home"    value="dddd"    />
    </jsp:include>
</div>
<div id="container" >
<div class="wrapper">
<div class="referbidbox">
<div class="refer_step step1">
    <ul>
        <li class="now"><spring:message code='race_info.msg.descriptionDemand' /></li>
        <li><spring:message code='race_info.msg.identificationOfNeeds' /></li>
        <li class="last"><spring:message code='race_info.msg.demandRelease' /></li>
    </ul>
</div>
<div class="referform nomorder">
<form id="taskForm" name="taskForm"  method="POST">

<input type="hidden" id="race_id" name="race_id"/>

<ul>
<li class="formli">
    <dl class="clearfix">
        <dt><spring:message code='race_info.msg.title' /></dt>
        <dd><input type="text" name="title" id="title" value="" class="input_txt" /></dd>
    </dl>
</li>
<li class="formli">
    <dl class="clearfix">
        <dt><spring:message code='race_info.msg.description' /></dt>
        <dd><textarea class="text_con" id="description" name="description"></textarea>
            <%--<input type="text" id="" name="" value="" class="text_con" />--%>
        </dd>
    </dl>
</li>
<li class="formli">
    <dl class="clearfix">
        <dt><spring:message code='race_info.msg.pictureContest' /></dt>
        <dd>
            <div class="project_files">
                <ul class="clearfix" id="item_pic_ul">


                </ul>
            </div>
        </dd>
    </dl>
</li>
<li class="formli">
    <dl class="clearfix">
        <dt>&nbsp;</dt>
        <dd>
            <input type="button" name="" onclick="javascript:$(this).next().trigger('click')" class="addgrey_btn" value="<spring:message code='race_info.button.addPictureContest' />" />
            <input  type="file" style="display: none;" name="file" id="fulAchievements1" onchange="f_file_upload('fulAchievements1')" />
            <input type="hidden" name="item_pic" id="item_pic" />
            <input type="hidden" name="item_front_cover" id="item_front_cover" />
            <label id="item_pic_msg"></label>
        </dd>
    </dl>
</li>

<li class="formli">
    <dl class="clearfix">
        <dt><spring:message code='race_info.msg.postAttachments' /></dt>
        <dd>
            <div class="project_files">
                <ul class="clearfix" id="attachment_ul">

                </ul>
            </div>
        </dd>
    </dl>
</li>
<li class="formli">
    <dl class="clearfix">
        <dt>&nbsp;</dt>
        <dd>
            <input type="button" name="" onclick="javascript:$(this).next().trigger('click')" class="addgrey_btn" value="<spring:message code='race_info.button.addAttachments' />" />
            <input style="display: none" type="file" name="file" id="fulAchievements2" onchange="f_file_upload('fulAchievements2')">
            <input type="hidden" name="attachment" id="attachment" value="">

        </dd>
    </dl>
</li>
<li class="formli">
    <dl class="clearfix">
        <dt><spring:message code='race_info.msg.category' /></dt>
        <dd class="clearfix">
            <select name="first_class" id="first_class" class="select">

            </select>
            <select name="second_class" id="second_class" class="select" onchange="f_findSkill()">

            </select>

            <input type="hidden" id="first_class_type" value="">
            <input type="hidden" id="second_class_type" value="">
        </dd>
    </dl>
</li>
<li class="formli">
    <dl class="clearfix">
        <dt ><spring:message code='race_info.msg.demandForSkills' /></dt>
        <dd class="clearfix skill_list">
            <%--<a href="javascript:;" class="skill_li selected">技能名称</a>--%>
            <%--<a href="javascript:;" class="skill_li">技能名称</a>--%>
            <%--<c:forEach items="${initData.skillList}" var="skill">--%>
            <%--<a href="javascript:;" class="skill_li" value="${skill.id}">${skill.name}</a>--%>
            <%--</c:forEach>--%>
        </dd>
        <input type="hidden" id="skill" name="skill" value="">
    </dl>
</li>
<li class="formli">
    <dl class="clearfix">
        <dt><spring:message code='race_info.msg.demandStyle' /></dt>
        <dd class="clearfix">
            <select name="style" id="style" class="select">

                <c:forEach items="${initData.styleList}" var="style">
                    <option value="${style.id}">${style.name}</option>
                </c:forEach>

            </select>
        </dd>
    </dl>
</li>
<li>
    <dl class="clearfix">
        <dt><spring:message code='race_info.msg.rewardBonus' /></dt>
        <dd>
            <div class="rewardlist">
                <input type="hidden" id="racePrizes" name="racePrizes"/>
                <table cellpadding="0" id="prizeTable" cellspacing="0" border="0">
                    <thead>
                    <tr>
                        <th><spring:message code='race_info.msg.awardName' /></th>
                        <th><spring:message code='race_info.msg.numberOfPeople' /></th>
                        <th><spring:message code='race_info.msg.money' /></th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td><input type="text" id="" name="" class="input_name" value="<spring:message code='race_info.msg.awardWinning' />" /></td>
                        <td>
                            <div class="reward_number clearfix">
                                <input type="text" id="" onblur="f_numValidate(this,'moneyMsg')" name="" value="1" /><label><spring:message code='race_info.msg.name' /></label>
                            </div>
                        </td>
                        <td>
                            <div class="reward_moeny clearfix">
                                <input type="text" id="" onblur="f_moneyValidate(this,'moneyMsg')" name="" value="5000" /><label><spring:message code='race_info.msg.yuan' /></label>
                            </div>
                        </td>
                        <td>
                            <div class="delitem"><a onclick="f_delPrize(this)"><em>-</em><spring:message code='race_info.msg.deleteThis' /></a></div>
                        </td>
                    </tr>


                    </tbody>
                    <tfoot>
                    <tr>
                        <td colspan="2"><input type="button" onclick="f_addPrize()" name="" class="addgrey_btn" value="<spring:message code='race_info.msg.addingA' />" /></td>
                        <td colspan="2"><span id="moneyMsg"></span></td>
                    </tr>
                    </tfoot>
                </table>
            </div>
        </dd>
    </dl>
</li>
<li class="formli">
    <dl class="clearfix">
        <dt><spring:message code='race_info.msg.callTime' /></dt>
        <dd class="clearfix">
            <input type="radio" name="race_time" value="15" checked="checked" class="radio_sel" id="race_time1" /><label for="race_time1"><spring:message code='race_info.msg.standard15Days' /></label>
            <input type="radio" name="race_time" value="7" class="radio_sel" id="race_time2"/><label for="race_time2"><spring:message code='race_info.msg.urgent7Days' /></label>

            <input type="radio"  name="race_time" id="race_time" value="10" class="radio_sel" /><label for="race_time"><spring:message code='race_info.msg.custom' /></label>
            <div class="txtnumber">
                <input type="text" id="i_race_time" name="i_race_time" value="10" onchange="f_setRadio('race_time',this)" class="input_num" />
                <input type="button" class="btn_add" value="+" onclick="f_buttonAdd('i_race_time','race_time')"/>
                <input type="button" class="btn_jian" value="-" onclick="f_buttonMinus('i_race_time','race_time')"/>
            </div>
            <label for="race_time"><spring:message code='race_info.msg.day' /></label>
            <label id="race_time_msg"></label>
        </dd>
    </dl>
</li>



<li class="formli">
    <dl class="clearfix">
        <dt><spring:message code='race_info.msg.chargeCard' /></dt>
        <dd class="clearfix">
            <select id="use_fee" name="use_fee" class="select">
                <option value="101002"><spring:message code='race_info.option.doNotUse' /></option>
                <option value="101001"><spring:message code='race_info.option.use' /></option>

            </select>
            <label><spring:message code='race_info.msg.currentHoldings' arguments="${initData.fee_num}" argumentSeparator=","/></label>
        </dd>
    </dl>
</li>
<li class="formli">
    <dl class="clearfix">
        <dt><spring:message code='race_info.msg.valueAdded' /></dt>
        <dd class="clearfix" id="addValueDD">


            <c:forEach items="${initData.addValue}" var="addValue">

                <div class="zsys">

                    <input type="checkbox" name="" value="${addValue.id}"  />

                    <label>
                            ${addValue.name}(￥${addValue.price})
                        <em>${addValue.description}</em>
                    </label>
                </div>

            </c:forEach>

            <input type="hidden" id="addvalue_ids"  name="addvalue_ids" value="">

        </dd>
    </dl>
</li>
<li class="formli">
    <dl class="clearfix">
        <dt>&nbsp;</dt>
        <dd class="clearfix">
            <input type="button" onclick="f_saveItem()" id="" name="" value="<spring:message code='race_info.button.next' />" class="submitnext" />
        </dd>
    </dl>
</li>
</ul>
</form>
</div>
</div>
</div>
</div>
<div id="footer">

    <!--content-->
    <jsp:include page="../public/footer.jsp"></jsp:include>
</div>

</body>
</html>
